//
//  RadioCell.m
//  Leisure
//
//  Created by xalo on 16/6/30.
//  Copyright © 2016年 朱旭东. All rights reserved.
//

#import "TopicCell.h"
@interface TopicCell ()

@property (weak, nonatomic) IBOutlet UIImageView *converImg;
@property (weak, nonatomic) IBOutlet UILabel *info;
@property (weak, nonatomic) IBOutlet UILabel *title;
@property (weak, nonatomic) IBOutlet UILabel *leftLaber;
@property (weak, nonatomic) IBOutlet UIButton *clickBtn;

@end
@implementation TopicCell

- (void)setCellWithModel:(TopicModel *)model {
    

    
    NSArray *array = [NSArray  arrayWithObjects:[UIImage  imageNamed:@"3.jpg"],[UIImage  imageNamed:@"4.jpg"],[UIImage  imageNamed:@"6.jpg"],[UIImage imageNamed:@"7.jpg"], nil];
    int a = rand() % 4;
    UIImage *image = [array  objectAtIndex:a];
    [self.converImg sd_setImageWithURL:[NSURL  URLWithString:model.coverimg] placeholderImage:image] ;
    self.title.text = model.title;
    self.info.text= model.content;
    self.leftLaber.text = model.addtime_f;
    
    [self.clickBtn setTitle:[NSString stringWithFormat:@"%@",[model  valueForKey:@"comment"]] forState:UIControlStateNormal];
    
}

- (IBAction)btnAction:(id)sender {
    if (self.btnBlock) {
        self.btnBlock();
    }
    
}


- (void)awakeFromNib {
    
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    
}

@end
